/*
 * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[欢迎加盟知启蒙，一起邂逅框架梦]
 * 
 * https://www.zhiqim.com/gitcan/zhiqim/zhiqim_account.htm
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.zhiqim.account.dbo.user;

import java.io.Serializable;
import java.sql.Timestamp;

import org.zhiqim.kernel.annotation.AnAlias;
import org.zhiqim.kernel.annotation.AnNew;
import org.zhiqim.kernel.json.Jsons;
import org.zhiqim.orm.annotation.*;

/**
 * 用户交易表 对应表《USER_TRADE》
 */
@AnAlias("UserTrade")
@AnNew
@AnTable(table="USER_TRADE", key="TRADE_ID", type="InnoDB")
public class UserTrade implements Serializable
{
    private static final long serialVersionUID = 1L;

    @AnTableField(column="USER_ID", type="long", notNull=true)    private long userId;    //1.用户编号
    @AnTableField(column="TRADE_ID", type="long", notNull=true)    private long tradeId;    //2.交易编号
    @AnTableField(column="TRADE_TIME", type="datetime", notNull=true)    private Timestamp tradeTime;    //3.交易时间
    @AnTableField(column="TRADE_TYPE", type="string,20", notNull=true)    private String tradeType;    //4.交易类型，充值：PAY，退款：REFUND
    @AnTableField(column="TRADE_PARTY", type="string,20", notNull=true)    private String tradeParty;    //5.交易第三方
    @AnTableField(column="TRADE_PARTY_NO", type="string,64", notNull=false)    private String tradePartyNo;    //6.交易第三方流水号
    @AnTableField(column="TRADE_PARTY_SUBJECT", type="string,64", notNull=false)    private String tradePartySubject;    //7.交易第三方标题
    @AnTableField(column="TRADE_PARTY_ACCOUNT", type="string,100", notNull=false)    private String tradePartyAccount;    //8.交易第三方账号
    @AnTableField(column="TRADE_AMOUNT", type="int", notNull=true)    private int tradeAmount;    //9.交易金额，单位：分
    @AnTableField(column="TRADE_DATA", type="long", notNull=true)    private long tradeData;    //10.交易产生的原始编号，如退款和消费时的原交易编号，没有填入0
    @AnTableField(column="USER_BALANCE", type="long", notNull=true)    private long userBalance;    //11.交易之后用户余额，单位：分

    public String toString()
    {
        return Jsons.toString(this);
    }

    public long getUserId()
    {
        return userId;
    }

    public void setUserId(long userId)
    {
        this.userId = userId;
    }

    public long getTradeId()
    {
        return tradeId;
    }

    public void setTradeId(long tradeId)
    {
        this.tradeId = tradeId;
    }

    public Timestamp getTradeTime()
    {
        return tradeTime;
    }

    public void setTradeTime(Timestamp tradeTime)
    {
        this.tradeTime = tradeTime;
    }

    public String getTradeType()
    {
        return tradeType;
    }

    public void setTradeType(String tradeType)
    {
        this.tradeType = tradeType;
    }

    public String getTradeParty()
    {
        return tradeParty;
    }

    public void setTradeParty(String tradeParty)
    {
        this.tradeParty = tradeParty;
    }

    public String getTradePartyNo()
    {
        return tradePartyNo;
    }

    public void setTradePartyNo(String tradePartyNo)
    {
        this.tradePartyNo = tradePartyNo;
    }

    public String getTradePartySubject()
    {
        return tradePartySubject;
    }

    public void setTradePartySubject(String tradePartySubject)
    {
        this.tradePartySubject = tradePartySubject;
    }

    public String getTradePartyAccount()
    {
        return tradePartyAccount;
    }

    public void setTradePartyAccount(String tradePartyAccount)
    {
        this.tradePartyAccount = tradePartyAccount;
    }

    public int getTradeAmount()
    {
        return tradeAmount;
    }

    public void setTradeAmount(int tradeAmount)
    {
        this.tradeAmount = tradeAmount;
    }

    public long getTradeData()
    {
        return tradeData;
    }

    public void setTradeData(long tradeData)
    {
        this.tradeData = tradeData;
    }

    public long getUserBalance()
    {
        return userBalance;
    }

    public void setUserBalance(long userBalance)
    {
        this.userBalance = userBalance;
    }

}
